package com.lyhui.nursinguser5010.service.impl;

import com.lyhui.nursinguser5010.pojo.IdentityAuthentication;
import com.lyhui.nursinguser5010.dao.IdentityAuthenticationMapper;
import com.lyhui.nursinguser5010.service.IdentityAuthenticationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * IdentityAuthentication表的服务实现类
 *
 * @author lyhui
 * @create-time 2020-02-19 00:36:37
 */
@Service("identityAuthenticationService")
public class IdentityAuthenticationServiceImpl implements IdentityAuthenticationService {
    //private static final Logger logger = LoggerFactory.getLogger(IdentityAuthenticationServiceImpl.class);
    
    @Resource
    private IdentityAuthenticationMapper identityAuthenticationMapper;
    
    /**
     * 查询IdentityAuthentication表的所有记录
     *
     * @return IdentityAuthentication的实例对象集合List（封装了IdentityAuthentication表的所有记录）
     */
    @Override
    public List<IdentityAuthentication> queryAllIdentityAuthentication() {
        return this.identityAuthenticationMapper.queryAllIdentityAuthentication();
    }
    
    /**
     * 查询IdentityAuthentication表中的一条记录
     *
     * @param  identityAuthentication（封装了相关查询条件）
     * @return IdentityAuthentication的实例对象（封装了IdentityAuthentication表的一条记录）
     */
     @Override
    public IdentityAuthentication queryIdentityAuthenticationByParam(IdentityAuthentication identityAuthentication){
        if(identityAuthentication==null){
            return null;
        }
        return this.identityAuthenticationMapper.queryIdentityAuthenticationByParam(identityAuthentication);
    }
    
    /**
     * 查询IdentityAuthentication表中的多条记录
     *
     * @param  identityAuthentication（封装了相关查询条件）
     * @return IdentityAuthentication的实例对象集合List（封装了IdentityAuthentication表的多条记录）
     */
    public List<IdentityAuthentication> queryIdentityAuthenticationListByParam(IdentityAuthentication identityAuthentication){
        if(identityAuthentication==null){
            return null;
        }
        return this.identityAuthenticationMapper.queryIdentityAuthenticationListByParam(identityAuthentication);
    }
    
    /**
     * 在IdentityAuthentication表中的添加一条记录
     *
     * @param  identityAuthentication（封装了想要添加的记录信息）
     * @return 添加记录的反馈结果(1:添加记录成功；0：添加记录失败)
     */
    @Override
    public int insertIdentityAuthentication(IdentityAuthentication identityAuthentication) {
        if(identityAuthentication==null){
            return 0;
        }
        return this.identityAuthenticationMapper.insertIdentityAuthentication(identityAuthentication);
    }

    /**
     * 修改IdentityAuthentication表中的一条记录
     *
     * @param  identityAuthentication（封装了准备修改的记录信息）
     * @return 修改记录的反馈结果(1:修改记录成功；0：修改记录失败)
     */
    @Override
    public int updateIdentityAuthentication(IdentityAuthentication identityAuthentication) {
        if(identityAuthentication==null){
            return 0;
        }
        return this.identityAuthenticationMapper.updateIdentityAuthentication(identityAuthentication);
    }

    /**
     * 删除IdentityAuthentication表中的一条记录
     *
     * @param  authenticationId ： IdentityAuthentication表的主键
     * @return 删除记录反馈结果(1：删除记录成功|0：删除记录失败)
     */
    @Override
    public int deleteIdentityAuthenticationById(Integer authenticationId) {
        if(authenticationId==null){
            return 0;
        }
        return this.identityAuthenticationMapper.deleteIdentityAuthenticationById(authenticationId);
    }
}